home *** CD-ROM | disk | FTP | other *** search
- /*
- * route.c
- *
- * Copyright (C) 1994 First Class Technology.
- */
-
- #include<stdio.h>
- #include<stdlib.h>
- #include<string.h>
-
- #include"tcpipdrv.h"
- #include"network.h"
-
- _ti_func search_ti_entry (void);
-
- /************************************************
- * *
- ************************************************/
- rtable *
- rt_top (route **def)
- {
- _ti_func func = search_ti_entry ();
-
- if (func)
- return (rtable *) func (_TI_rt_top, (long *)def);
- return NULL;
- }
-
- /************************************************
- * *
- ************************************************/
- route *
- rt_lookup (long ip)
- {
- _ti_func func = search_ti_entry ();
-
- if (func)
- return (route *) func (_TI_rt_lookup, (long *)ip);
-
- return NULL;
- }
-
- /************************************************
- * *
- ************************************************/
- route *
- rt_lookupb (long ip, unsigned int bits)
- {
- _ti_func func = search_ti_entry ();
- long arg[2];
-
- arg[0] = ip;
- arg[1] = bits;
- if (func)
- return (route *) func (_TI_rt_lookupb, arg);
-
- return NULL;
- }
-
- /************************************************
- * *
- ************************************************/
- int
- rt_drop (long target, unsigned int bits)
- {
- _ti_func func = search_ti_entry ();
- long arg[2];
-
- arg[0] = target;
- arg[1] = bits;
- if (func)
- return (long)func (_TI_rt_drop, arg);
-
- return -1;
- }
-
- /************************************************
- * *
- ************************************************/
- route *
- rt_add (long ip, unsigned int bits, long gateway, iface * Iface,
- long metric, long ttl, char private)
- {
- _ti_func func = search_ti_entry ();
- long arg[7];
-
- arg[0] = ip;
- arg[1] = bits;
- arg[2] = gateway;
- arg[3] = (long)Iface;
- arg[4] = metric;
- arg[5] = ttl;
- arg[6] = private;
-
- if (func)
- return (route *) func (_TI_rt_add, arg);
-
- return NULL;
- }
-
-
-
-